﻿@using System.Web.Optimization
@using KRM.Core

@using KRM.Core.Library
@{
    Layout = null;
    var controller = Url.RequestContext.RouteData.Values["controller"] ?? "";
}
<html lang="en" class="no-js">
<!-- BEGIN HEAD -->
<head>
    <meta charset="utf-8">
    <title>@ViewBag.Title</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content="width=device-width, initial-scale=1.0" name="viewport">
    <meta name="ROBOTS" content="NOINDEX, NOFOLLOW">
    <meta content="" name="description">
    <meta content="" name="author">
    <meta name="MobileOptimized" content="320">
    <!--[if lt IE 9]>
        <script src="/hr/js/plugins/respond.min.js"></script>
        <script src="/hr/js/plugins/excanvas.min.js"></script> 
    <![endif]-->
    @Styles.Render("~/bundles/hrcss")
    <link rel="shortcut icon" href="/img/favicon.ico">
    <!-- END JAVASCRIPTS -->
    @Scripts.Render("~/bundles/hrjquery")
    <script src="/signalr/hubs" type="text/javascript"></script>
    <script src="~/js/espresso.js"></script>
</head>
<!-- END HEAD -->
<!-- BEGIN BODY -->

<body class="page-header-fixed" style="">
    @if (tblCompanyVariable.ListIpAccessKRMWeb.Contains(Request.UserHostAddress))
    {
        if (User.Identity.IsAuthenticated)
        {
            var user = Users.Current(User.Identity.Name);
            var menus = new GroupMenu();
        <!-- BEGIN HEADER -->
        <div class="header navbar navbar-inverse navbar-fixed-top ">
            <!-- BEGIN TOP NAVIGATION BAR -->
            <div class="header-inner">
                <!-- BEGIN LOGO -->
                @*<a class="navbar-brand" href="/" style="padding-top: 10px; padding-bottom: 10px">
                    <img src="/hr/img/logo.png" alt="logo" class="img-responsive" style="height: 24px">
                </a>*@
                <a class="navbar-brand" href="/" style="padding-top: 6px; padding-bottom: 0px">
                    <img src="/hr/img/logokybotech.png" alt="logo" class="img-responsive" style="height: 31px;">
                </a>
                <!-- END LOGO -->
                <!-- BEGIN RESPONSIVE MENU TOGGLER -->
                <a href="javascript:;" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <img src="/hr/img/menu-toggler.png" alt="" style="padding-top: 6px;">
                </a>
                <!-- END RESPONSIVE MENU TOGGLER -->
                <!-- BEGIN TOP NAVIGATION MENU -->
                <ul class="nav navbar-nav pull-right">
                    <!-- BEGIN NOTIFICATION DROPDOWN -->
                    <li class="dropdown" id="header_notification_bar">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" data-close-others="true" style="height: 42px" onclick="loadBookNotifi()">
                            <i class="icon-warning-sign"></i>
                            <span class="badge" id="Menu_CountUnreadBookNotification" style="display: none">0</span>
                        </a>
                        <ul class="dropdown-menu extended notification" id="listNewBookNotification">
                        </ul>
                    </li>

                    <!-- END NOTIFICATION DROPDOWN -->
                    <!-- BEGIN INBOX DROPDOWN -->

                    <!-- END INBOX DROPDOWN -->

                    <!-- BEGIN USER LOGIN DROPDOWN -->
                    <li class="dropdown user">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" data-close-others="true">
                            <img alt="" src="/Upload/Avatar/@(user.Avatar ?? "avatar-default.jpg")" style="text-align: center;height:29px;max-width:29px;background-color: #ddd !important;">
                            <span class="username">@user.Username</span>
                            <input type="hidden" id="ajaxcurrentuserid"value="@user.UserID" />
                            <input type="hidden" id="ajaxcurrentpersonalid"value="@user.HRPersonalId" />
                            <i class="icon-angle-down"></i>
                        </a>
                        <ul class="dropdown-menu">
                            <li><a href="/profile/myprofile"><i class="icon-user"></i>My Profile</a></li>
                            @if (user.UserID == 371)
                            {
                                <li id="startrelease"><a href="javascript:;"><i class="icon-play"></i>Start Release</a></li>
                                <li id="stoprelease" style="display: none"><a href="javascript:;"><i class="icon-stop"></i>Stop Release</a></li>
                            }
                            <li class="divider"></li>
                            <li><a href="javascript:;" id="trigger_fullscreen"><i class="icon-move"></i>Full Screen</a>
                            </li>
                            <li><a href="/users/logout"><i class="icon-key"></i>Log Out</a>
                            </li>
                        </ul>
                    </li>
                    <!-- END USER LOGIN DROPDOWN -->
                </ul>
                <!-- END TOP NAVIGATION MENU -->
            </div>
            <!-- END TOP NAVIGATION BAR -->
        </div>
        <!-- END HEADER -->
        <div class="clearfix"></div>
        <!-- BEGIN CONTAINER -->
        <div class="page-container">
            <!-- BEGIN SIDEBAR -->
            <div class="page-sidebar navbar-collapse collapse fixed">
                <!-- BEGIN SIDEBAR MENU -->
                <ul class="page-sidebar-menu">
                    <li>
                        <!-- BEGIN SIDEBAR TOGGLER BUTTON -->
                        <div class="sidebar-toggler hidden-phone"></div>
                        <div style="height: 15px"></div>
                        <!-- BEGIN SIDEBAR TOGGLER BUTTON -->
                    </li>

                    @{
                            string urlMenuLink = null;
                            try
                            {
                                urlMenuLink = ViewBag.UrlLink;
                            }
                            catch { }
                    }
                    <li class="start @(urlMenuLink == "home" ? "active" : "")">
                        <a href="/">
                            <i class="icon-home"></i>
                            <span class="title">News Feed</span>
                            <span class='selected'></span>
                        </a>
                    </li>
                    @Html.Raw(menus.LoadKnowledgeBase(user, controller.ToString()))
                    @Html.Raw((menus.LoadGroupMenuHr(user.UserLogin, urlMenuLink ?? Request.RawUrl)))
                    @Html.Raw(menus.LoadLogs(user, controller.ToString()))
                </ul>
                <!-- END SIDEBAR MENU -->
            </div>
            <!-- END SIDEBAR -->
            <!-- BEGIN PAGE -->
            <div class="page-content">
                @RenderBody()
            </div>
            <!-- END PAGE -->
        </div>
        <!-- END CONTAINER -->
        <!-- BEGIN FOOTER -->
        <div class="footer">
            <div class="footer-inner">
                2013 © by VCN Corporation.
            </div>
            <div class="footer-tools">
                <span class="go-top">
                    <i class="icon-angle-up"></i>
                </span>
            </div>
        </div>
        <!-- END FOOTER -->

        }
        else
        {
        @RenderBody()
            var returnUrl = Request.RawUrl != "/" ? "?returnurl=" + Request.RawUrl : "";
            Response.Redirect("/users/login" + returnUrl);
        }
    }
    else
    {
        @RenderBody()
        Response.Redirect("/users/invalidipaddress");
    }
    @Scripts.Render("~/bundles/hrjs")
    @RenderSection("Scripts", false)
    <script>
        (function (i, s, o, g, r, a, m) {
            i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () {
                (i[r].q = i[r].q || []).push(arguments)
            }, i[r].l = 1 * new Date(); a = s.createElement(o),
            m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m)
        })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
        ga('create', 'UA-6581490-8', 'loveespres.so');
        ga('send', 'pageview');
    </script>
    @*<script type="text/javascript">
        (function () {
            var s = document.createElement("script");
            s.type = "text/javascript";
            s.async = true;
            s.src = '//api.usersnap.com/load/' +
                    'e40bb243-4169-4908-9962-85443cc00656.js';
            var x = document.getElementsByTagName('script')[0];
            x.parentNode.insertBefore(s, x);
        })();
    </script>*@
</body>
</html>
